package com.reger.core.exception;

public enum GlobalExceptionStatus implements ExceptionStatus {
	
	OK(Level.DEBUG,0, "操作成功"), 
	NOT_FOUND(400, "请求资源不存在"),
	NO_ID_FOUND(401, "没有找到该编号的数据"),
	ACCESS_DENIED(403, "访问被拒绝"),
	INFO(404, "提示"), 
	WARN(Level.WARN,405, "警告"), 
	ERROR(Level.ERROR,500, "操作失败"), 
	VALID_FAIL(501, "参数校验失败"),
	USER_NOT_LOGIN(600, "用户未登录"),
	;
	
	private int code;
	private Level level;
	private String message;

	GlobalExceptionStatus(int code, String message) {
		this(Level.INFO, code, message);
	}

	GlobalExceptionStatus(Level level, int code, String message) {
		this.message = message;
		this.code = code;
		this.level = level;
	}

	@Override
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	@Override
	public Level getLevel() {
		return level;
	}

	public void setLevel(Level level) {
		this.level = level;
	}

	@Override
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}
